﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices.ComTypes;
using System.Text;
using System.Runtime.InteropServices;
namespace SilverlightViewport.Common.Interop
{
    [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("00020401-0000-0000-C000-000000000046")]
    public interface ITypeInfo
    {
        [PreserveSig]
        int GetTypeAttr(ref IntPtr pTypeAttr);
        [PreserveSig]
        int GetTypeComp([Out, MarshalAs(UnmanagedType.LPArray)] ITypeComp[] ppTComp);
        [PreserveSig]
        int GetFuncDesc([In, MarshalAs(UnmanagedType.U4)] int index, ref IntPtr pFuncDesc);
        [PreserveSig]
        int GetVarDesc([In, MarshalAs(UnmanagedType.U4)] int index, ref IntPtr pVarDesc);
        [PreserveSig]
        int GetNames(int memid, [Out, MarshalAs(UnmanagedType.LPArray)] string[] rgBstrNames, [In, MarshalAs(UnmanagedType.U4)] int cMaxNames, [Out, MarshalAs(UnmanagedType.LPArray)] int[] pcNames);
        [PreserveSig]
        int GetRefTypeOfImplType([In, MarshalAs(UnmanagedType.U4)] int index, [Out, MarshalAs(UnmanagedType.LPArray)] int[] pRefType);
        [PreserveSig]
        int GetImplTypeFlags([In, MarshalAs(UnmanagedType.U4)] int index, [Out, MarshalAs(UnmanagedType.LPArray)] int[] pImplTypeFlags);
        [PreserveSig]
        int GetIDsOfNames(IntPtr rgszNames, int cNames, IntPtr pMemId);
        [PreserveSig]
        int Invoke();
        [PreserveSig]
        int GetDocumentation(int memid, ref string pBstrName, ref string pBstrDocString, [Out, MarshalAs(UnmanagedType.LPArray)] int[] pdwHelpContext, [Out, MarshalAs(UnmanagedType.LPArray)] string[] pBstrHelpFile);
        [PreserveSig]
        int GetDllEntry(int memid, tagINVOKEKIND invkind, [Out, MarshalAs(UnmanagedType.LPArray)] string[] pBstrDllName, [Out, MarshalAs(UnmanagedType.LPArray)] string[] pBstrName, [Out, MarshalAs(UnmanagedType.LPArray)] short[] pwOrdinal);
        [PreserveSig]
        int GetRefTypeInfo(IntPtr hreftype, ref ITypeInfo pTypeInfo);
        [PreserveSig]
        int AddressOfMember();
        [PreserveSig]
        int CreateInstance([In] ref Guid riid, [Out, MarshalAs(UnmanagedType.LPArray)] object[] ppvObj);
        [PreserveSig]
        int GetMops(int memid, [Out, MarshalAs(UnmanagedType.LPArray)] string[] pBstrMops);
        [PreserveSig]
        int GetContainingTypeLib([Out, MarshalAs(UnmanagedType.LPArray)] ITypeLib[] ppTLib, [Out, MarshalAs(UnmanagedType.LPArray)] int[] pIndex);
        [PreserveSig]
        void ReleaseTypeAttr(IntPtr typeAttr);
        [PreserveSig]
        void ReleaseFuncDesc(IntPtr funcDesc);
        [PreserveSig]
        void ReleaseVarDesc(IntPtr varDesc);
    }


}
